#include "NPC.h"
#include "CONSTANTS.h"

NPC::NPC(LPDIRECT3DDEVICE9 device,IXAnimator *XAnim, int* GameStateP, std::string* MessageP, int ID): InteractableObject(device,npcArray[ID].x,npcArray[ID].z,npcArray[ID].yrot)
{
	NPCtype = npcArray[ID].type;
	NPCspeech = npcArray[ID].speech;
	loadModelXA(XAnim,device,"NPCModel1.x");
	Model.nextAnimSet = 0;
	Radius = 15;
	interactRadius = Radius + 20;
	GameStateP_ = GameStateP;
	MessageP_ = MessageP;
}


NPC::~NPC(void)
{

}
void NPC::Interact()
{
	MessageP_ ->assign(NPCspeech);
	switch(NPCtype)
	{
	case NORMAL_NPC:
		*GameStateP_ = DIALOGUE;
		break;

	case SHOP_NPC:
		*GameStateP_ = SHOP;
		break;

	case INN_NPC:
		*GameStateP_ = INN;
		break;
	}
}